<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <title>两面翻转</title>
    <style>
      .out {
        width: 200px;
        height: 200px;
        /*perspective: 200px;*/
        transform-style: preserve-3d;
        transition: all 1s;
      }
      .out:hover {
        transform: rotateY(180deg);
      }
      .fir,
      .sec {
        position: absolute;
        width: 200px;
        height: 200px;
        text-align: center;
        line-height: 200px;
        color: white;
        font-size: 20px;
        border-radius: 100px;
      }
      .fir {
        background-color: #00a4ff;
        transform: translateZ(1px);
      }

      .sec {
        /*backface-visibility: hidden;*/
        background-color: pink;
        transform: rotateY(180deg);
      }
    </style>
  </head>
  <body>
    <div class="out">
      <div class="fir">你是</div>
      <div class="sec">大肥猪</div>
    </div>
  </body>
</html>
